c664c7
@@ -650,12 +650,13 @@
public class XmlFlowModelBuilder implements FlowModelBuilder {
 				String flowId;
 				String stateId;
 				AbstractStateModel parentState = null;
-				if (!parent.contains("#")) {
+				int hashIndex = parent.indexOf("#");
+				if (hashIndex == -1) {
 					throw new FlowModelBuilderException("Invalid parent syntax '" + parent
 							+ "', should take form 'flowId#stateId'");
 				}
-				flowId = parent.substring(0, parent.indexOf("#")).trim();
-				stateId = parent.substring(parent.indexOf("#") + 1).trim();
+				flowId = parent.substring(0, hashIndex).trim();
+				stateId = parent.substring(hashIndex + 1).trim();
 				try {
 					parentState = modelLocator.getFlowModel(flowId).getStateById(stateId);
 					if (parentState == null) {
